<?php
class AddCommentsForm extends Zend_Form
{
	public function init()
	{
		$fronController = Zend_Controller_Front::getInstance();
		$request = $fronController->getRequest();
		$id = $request->getParam('id');
		
		$issueid = $this->createElement('hidden','issueid');
		$issueid->setValue($id)
				->setDecorators(array(
							'viewHelper',
							'Errors',
							array('Description', array('tag'=>'', 'escape'=>false)),
							array(array('data'=>'HtmlTag'),
								array('tag'=>'td', 'valign'=>'top','colspan'=>2,'style'=>'background-color:#ffffff')),
							//array('Label', array('tag'=>'td')),
							array(array('row'=>'HtmlTag'), array('tag'=>'tr'))
				));
		
		$action_body = $this->createElement('textarea','action_body');
		$action_body->setLabel('Comments:')
					->setAttrib('rows',8)
					->setAttrib('style','width:90%')
					->setAttrib('cols',40)
					->setRequired(true);
					
		$add = $this->createElement('submit','add');
		$add->setLabel('Add')
				->setDecorators(array(
							'viewHelper',
								'Errors',
								array('Description', array('tag'=>'', 'escape'=>false)),
								array(array('data'=>'HtmlTag'),
									array('tag'=>'td', 'valign'=>'top', 'style'=> 'background-color:#ffffff;text-align:center','colspan'=>2,'align'=>'center')),
								//array('Label', array('tag'=>'td')),
								array(array('row'=>'HtmlTag'), array('tag'=>'tr'))
				));
				
		$this->addElements(array(
						$action_body,
						$issueid,
						$add
		));
		
		$this->setElementDecorators(array(
								'viewHelper',
								'Errors',
								array('Description', array('tag'=>'', 'escape'=>false)),
								array(array('data'=>'HtmlTag'),
									array('tag'=>'td', 'valign'=>'top', 'style'=> 'background-color:#ffffff;text-align:left')),
								array('Label', array('tag'=>'td')),
								array(array('row'=>'HtmlTag'), array('tag'=>'tr'))),
								array('action_body')
								);
								
		$this->addDecorators(array(
				'FormElements',
				array('HtmlTag', array('tag' => 'table','width'=>'100%','cellspacing'=>'0','border'=>'0','class'=>'pform')),
				'Form'
		));
	}
}